﻿using System;

namespace Vosc.Coff
{
	// Token: 0x02000023 RID: 35
	public class CoffSection
	{
		// Token: 0x1700001D RID: 29
		// (get) Token: 0x060000CD RID: 205 RVA: 0x0000D1E4 File Offset: 0x0000B3E4
		public ushort Size
		{
			get
			{
				return this.size;
			}
		}

		// Token: 0x1700001E RID: 30
		// (get) Token: 0x060000CE RID: 206 RVA: 0x0000D1EC File Offset: 0x0000B3EC
		public uint StartAddress
		{
			get
			{
				return this.startAddress;
			}
		}

		// Token: 0x1700001F RID: 31
		// (get) Token: 0x060000CF RID: 207 RVA: 0x0000D1F4 File Offset: 0x0000B3F4
		public ushort[] Contents
		{
			get
			{
				return this.contents;
			}
		}

		// Token: 0x060000D0 RID: 208 RVA: 0x0000D1FC File Offset: 0x0000B3FC
		public CoffSection(ushort size, uint startAddress)
		{
			this.size = size;
			this.startAddress = startAddress;
			this.contents = new ushort[(int)size];
			this.offset = 0;
		}

		// Token: 0x060000D1 RID: 209 RVA: 0x0000D228 File Offset: 0x0000B428
		public bool WriteWord(ushort value)
		{
			if (this.offset >= this.contents.Length)
			{
				return false;
			}
			this.contents[this.offset++] = value;
			return true;
		}

		// Token: 0x060000D2 RID: 210 RVA: 0x0000D261 File Offset: 0x0000B461
		public int GetBlockCount(int blockWordSize)
		{
			return (int)this.size / blockWordSize + (((int)this.size % blockWordSize > 0) ? 1 : 0);
		}

		// Token: 0x04000109 RID: 265
		private ushort size;

		// Token: 0x0400010A RID: 266
		private uint startAddress;

		// Token: 0x0400010B RID: 267
		private ushort[] contents;

		// Token: 0x0400010C RID: 268
		private int offset;
	}
}
